<?php
use common\components\helpers\Fun;
use common\components\extenders\MenuManage;
?>
<div class="yx-praise-list-box yx-praise-box yx-radius2">
  <div class="docs-main zx-mg">
    <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"  >
    <tr class="yx-bgd2f6ec">
        <th>学生姓名</th>
        <th>家长姓名</th>
        <th>电话号码</th>
        <th>卡号</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
  <?php if($details) { ?>
    <?php foreach ($details as $k => $v) { ?>
        <tr>
            <td><?=isset($v->student->name)?\yii\helpers\Html::encode($v->student->name):''?></td>
            <td><?=isset($v->student->customer)?\yii\helpers\Html::encode($v->student->customer->name):''?></td>
            <td><?=isset($v->student->customer)? \yii\helpers\Html::encode($v->student->customer->mobile):'' ?></td>
            <td><?=isset($v->student->customer)? \yii\helpers\Html::encode($v->student->customer->card_id):'' ?></td>
            <td><?php
                switch($v->status){
                    case 0:
                        echo '未开课';
                        break;
                    case 1:
                        echo '上课中';
                        break;
                    case 2:
                        echo '已结课';
                        break;
                    case 3:
                        echo '已转班';
                        break;
                }
                ?></td>
            <td>
                <?php if(in_array($v->status,[0,1])) { ?>
                    <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('artclassmanage','transfer',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-radius2 yx-d-card yx-bg94d5a2','data'=>['id'=>$v->id,'name'=>'调班']]);?>
                    <?php if($v->studentCheck == null) { ?>
                        <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('artclassmanage','generatecheck',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-radius2 yx-d-card yx-bg94d5a2','data'=>['id'=>$v->id,'class_id'=>$v->class_manage_id,'name'=>'生成签到']]);?>
                    <?php } else { ?>
                        <button style="color:#ffffff;border: none;padding: 1px 12px;border-radius:2px" class="" type="button">生成签到</button>
                    <?php } ?>
                <?php } else { ?>
                    <button style="color:#ffffff;border: none;padding: 1px 12px;border-radius:2px" type="button">调班</button>
                    <button style="color:#ffffff;border: none;padding: 1px 12px;border-radius:2px" class="" type="button">生成签到</button>
                <?php }?>

                <?php if($v->status > 0  && $v->studentCheck != null){ ?>
                    <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('artclassmanage','sign',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-radius2 yx-d-card yx-bg94d5a2','data'=>['id'=>$v->id,'name'=>'上课情况']]);?>
                <?php }else{ ?>
                    <button style="color:#ffffff;border: none;padding: 1px 12px;border-radius:2px" type="button">上课详情</button>
                <?php } ?>
        </tr>
    <?php } ?>
   <?php } else { ?>
      <tr>
          <td colspan="6" align="center">暂无学生</td>
      </tr>
   <?php }?>
</table>
  </div>
</div>